<template>
  <div>
    <h3>待办列表</h3>
    <div v-for="(item, index) in todos" :key="index" class="todo-list">
      <span style="margin-right: 10px;"><b>id：</b>{{ item.id }}</span>
      <span style="margin-right: 10px;"><b>名称：</b>{{ item.name }}</span>
      <span><b>状态：</b>{{ item.completed }}</span>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { computed } from 'vue'
import { useStore } from 'vuex'
import { key } from '../store'
const store = useStore(key)
const todos = computed(() => store.state.todos?.todos)
</script>

<style>
</style>